package com.bps.zzant.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bps.zzant.dao.CustomerDAO;
import com.bps.zzant.model.Customer;


@Service
@Transactional

public class CustomerServiceImpl implements CustomerService {
	
	@Autowired
	CustomerDAO customerDAO;
		
	public CustomerDAO getCustomerDAO() {
		return customerDAO;
	}

	public void setCustomerDAO(CustomerDAO customerDAO) {
		this.customerDAO = customerDAO;
	}

	public List<Customer> getCustomersByName(String customerName) {
		customerName = "%"+customerName + "%";
		System.out.print("---------CustomerServiceImpl:" + customerName);		
		List<Customer> customerList = getCustomerDAO().getCustomersByName(customerName);
		return customerList;
	}

}
